home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / gsdbloo.exe / DEMOE004.PAS < prev    next >
Pascal/Delphi Source File  |  1992-02-24  |  2KB  |  69 lines

  1. program DemoE004;
  2. {------------------------------------------------------------------------------
  3.                               DBase File Display
  4.                               Expanded Sample 4
  5.                                  Demo Program
  6.  
  7.        Copyright (c)  Richard F. Griffin
  8.  
  9.        10 February 1992
  10.  
  11.        102 Molded Stone Pl
  12.        Warner Robins, GA  31088
  13.  
  14.        -------------------------------------------------------------
  15.        Use FieldDisplayScreen to display all record fields on-screen.
  16.  
  17.        **********  Not For Use in a TurboVision Environment  **********
  18.  
  19.        If it does not already exist, the DEMOE4.DBF file will be created
  20.        by using the MakeTestData procedure in GS_GENF.PAS.
  21.  
  22.        All fields in the dBase record will be displayed on-screen using
  23.        the FieldDisplayScreen procedure in GS_dBFld_Objt.  The memo
  24.        record may also be viewed (but not modified).
  25.  
  26.        Keys that may be used are:
  27.  
  28.             ESC    Exits
  29.             F10    Next Record
  30.             PgUp   Top of Record; Previous Record if Already at Top
  31.             PgDn   Bottom of Record; Next Record if at Bottom
  32.             Cursor Up, Down
  33.  
  34. -------------------------------------------------------------------------------}
  35.  
  36. uses
  37.    CRT,
  38.    DOS,
  39.    GS_KeyI,
  40.    GS_FileH,
  41.    GS_dBFld,
  42.    GS_dBase,
  43.    GS_GenF;
  44. var
  45.    MyFile  : GS_dBFld_Objt;
  46.    CkFile  : file;
  47.  
  48. begin
  49.    ClrScr;
  50.    if not GS_FileExists(CkFile,'DEMOE4.DBF') then
  51.    begin
  52.       writeln('Creating DemoE4.DBF');
  53.       MakeTestData('DemoE4', 20, true);
  54.       writeln('DEMOE4.DBF Created');
  55.       ClrScr;
  56.    end;
  57.    MyFile.Init('DEMOE4');
  58.    MyFile.Open;
  59.    MyFile.GetRec(Top_Record);
  60.    while (MyFile.FieldDisplayScreen) and (not MyFile.File_EOF) do
  61.    begin
  62.       if GS_KeyI_Chr = Kbd_PgUp then
  63.          MyFile.GetRec(Prev_Record)
  64.       else
  65.          MyFile.GetRec(Next_Record);
  66.    end;
  67.    MyFile.Close;
  68. end.
  69.